SQL Database Creation and Data Manipulation Quiz

MeaningfulWilliamsite3144 avatar
MeaningfulWilliamsite3144
·
·
Download

Start Quiz

Study Flashcards

10 Questions

Explain the purpose of the 'CONSTRAINT DEPTPK PRIMARY KEY (DEPTID)' in the 'DEPARTMENT1' table.

The purpose of the 'CONSTRAINT DEPTPK PRIMARY KEY (DEPTID)' is to define the DEPTID column as the primary key of the DEPARTMENT1 table, ensuring that each DEPTID value is unique and not null.

What is the significance of 'CONSTRAINT CHECKAGE CHECK (AGE BETWEEN 20 AND 60)' in the 'EMPLOYEE' table?

The 'CONSTRAINT CHECKAGE CHECK (AGE BETWEEN 20 AND 60)' ensures that the AGE column in the EMPLOYEE table only allows values between 20 and 60, restricting the entry of invalid age values.

Explain the purpose of 'CONSTRAINT PK_EMPLOYEE PRIMARY KEY (EMPID)' in the 'EMPLOYEE' table.

The 'CONSTRAINT PK_EMPLOYEE PRIMARY KEY (EMPID)' sets the EMPID column as the primary key of the EMPLOYEE table, ensuring that each EMPID value is unique and not null.

What is the function of 'CONSTRAINT FK_EMPLOYEE FOREIGN KEY(DEPTID) REFERENCES DEPARTMENT1(DEPTID)' in the 'EMPLOYEE' table?

The 'CONSTRAINT FK_EMPLOYEE FOREIGN KEY(DEPTID) REFERENCES DEPARTMENT1(DEPTID)' establishes the DEPTID column in the EMPLOYEE table as a foreign key referencing the DEPTID column in the DEPARTMENT1 table, enforcing referential integrity between the two tables.

Explain the purpose of the 'HIREDATE DATE' column in the 'EMPLOYEE' table.

The 'HIREDATE DATE' column in the EMPLOYEE table is used to store the date when an employee was hired, providing a record of the employee's start date within the company.

What are the column names and their data types for the table DEPARTMENT1?

DEPTID INT, DNAME VARCHAR(20), LOC VARCHAR(10), MGRID VARCHAR(20)

What are the details of the employee with EMPID 'E101'?

E101, ANAND, MANAGER, 2018-07-14, 40, 34000, 13

What is the HIREDATE for the employee with EMPID 'E100'?

2016-08-22

List the department names that are located in 'BOMBAY'?

RESEARCH, SALES

What are the constraints associated with the DEPARTMENT1 table?

DEPTPK PRIMARY KEY (DEPTID)

Test your SQL skills with this quiz on creating a database, defining a table, and inserting data. Challenge your knowledge of SQL commands and syntax with this hands-on quiz.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

SQL Schema and Query Quiz
5 questions

SQL Schema and Query Quiz

BreathtakingUvarovite avatar
BreathtakingUvarovite
SQL Fundamentals Quiz
18 questions

SQL Fundamentals Quiz

EntrancingBaritoneSaxophone avatar
EntrancingBaritoneSaxophone
Use Quizgecko on...
Browser
Browser