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

sql composite primary key

CREATE TABLE voting (
  QuestionID NUMERIC,
  MemberID NUMERIC,
  PRIMARY KEY (QuestionID, MemberID)
);
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 :: tsql set database ownership 
Sql :: suse status MySQL 
Sql :: oracle grant create job 
Sql :: sql constraint date greater than 
Sql :: SQL IN Operator With Columns 
Sql :: mysql auto increment jumping 
Sql :: difference between cross apply and inner join 
Sql :: start whith system mysql 
Sql :: does laravel validate sql 
Sql :: install package for sqlserver in asp.net core 
Sql :: sqlite escape single quote 
Sql :: flexible search query delete table 
Sql :: dataframe lambda elif 
Sql :: postgresql exploit 
Sql :: oracle table change tablespace lob column 
Sql :: mysql make date from 2 column 
Sql :: sql query to delete row by id 
Sql :: maximum number of tables in mysql 
Sql :: uninstall mysql centos 7 
Sql :: dbname+tablename 
Sql :: create mysql pool connection python flask 
Sql :: jooq replace 
Sql :: SQL Manipulação de Tabelas Constraint 
Sql :: what is union in sql 
Sql :: postgresql auto increment not working 
Sql :: multiple values insert in sql 
Sql :: postgresql get random data from table 
Sql :: add column mssql 
Csharp :: unity string split 
Csharp :: c# gzip byte array 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =