Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to define a composite primary key in sql

CREATE TABLE person(id INT, 
					name TEXT,
					PRIMARY KEY (id, name)
				   );
Comment

composite primary key sql

CREATE TABLE student
(rollNumber INT, 
name VARCHAR(30), 
class VARCHAR(30), 
section VARCHAR(1), 
mobile VARCHAR(10),
PRIMARY KEY (rollNumber, mobile)); -- This thing
Comment

how to define a non primary composite key in sql

ALTER TABLE dbo.YourTable
ADD CONSTRAINT UC_YourTable_Col1_Col2
UNIQUE(Col1, Col2)
Comment

composite primary key sql

CREATE TABLE student
(rollNumber INT, 
name VARCHAR(30), 
class VARCHAR(30), 
section VARCHAR(1), 
mobile VARCHAR(10),
PRIMARY KEY (rollNumber, mobile));
Comment

PREVIOUS NEXT
Code Example
Sql :: sql check if column exists 
Sql :: how to link java and mysql 
Sql :: mysql create database 
Sql :: SQL FROM-Klausel 
Sql :: primary key auto increment in postgresql 
Sql :: lumen 
Sql :: sql limit results 
Sql :: in sqlalchemy 
Sql :: oracle sysdba connect as another user 
Sql :: dynamic soql escape the single quote 
Sql :: psql list view rules 
Sql :: how to install mysql without admin rights 
Sql :: install sql 
Sql :: how to set up an anonymous function to variable in swift 
Sql :: mysql config address 
Sql :: sintaxis SELECT sql 
Sql :: sql trigger difference between for and after 
Sql :: mysql update column with value from another table 
Sql :: query archive mode 
Sql :: copy data from cell to cell mysql 
Sql :: permisos en mysql 
Sql :: oracle database connection visual studio 2019 
Sql :: what alter does in db 
Sql :: postgres row expiration 
Sql :: sap return 
Sql :: enable mysql remote connection to two specific ip address 
Sql :: populate sql table with random data 
Sql :: count record in same name condition 
Sql :: Jenkins SQLCMD run 
Sql :: C# check if mysql query modified rows 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =