Advertisements
Advertisements
Question
Write a SQL statement to create a table for employees having any five fields and create a table constraint for the employee table.
Advertisements
Solution
Table: emp
CREATE TABLE emp
(
empno integer NOTNULL,
empfname char(20),
emplname char(20),
Designation char(20),
Basicpay integer,
PRIMARY KEY (empfname,emplname) → Table constraint
);
APPEARS IN
RELATED QUESTIONS
The command to delete a table is ______
The clause used to sort data in a database.
Differentiate Unique and Primary Key constraint.
Which component of SQL lets inserts values in tables and which lets to create a table?
What is a constraint?
Write a short note on Primary key constraints.
Write a SQL statement to modify the student table structure by adding a new field.
Write the use of the Savepoint command with an example.
Construct the following SQL statement in the student table-
SELECT statement using GROUP BY clause.
Construct the following SQL statement in the student table-
SELECT statement using ORDER BY clause.
