Skip to content
Question
Q.

Mr. Sen has to create a table named ‘Employee’ with Columns to store EmpID, Name, Designation, Age and Salary. EmpID is the Primary key and Name cannot be NULL. Some of the rows that will be inserted are shown below.

101Smita KumarSecretary2839500.00
102Mani ScottProgrammer3245300.00
103Firdaus AliProgrammer II4567500.00

Write SQL query to create the above table with appropriate data types and sizes of columns. OR Ms. Rajshri is the Class Teacher of Class XII. She wants to create a table named ‘Student’ to store marks in different subjects of her class. Identify any 4 columns for the table along with their suitable data types.

CBSECBSE Class XII Board 2019Subjective· 2mImportance★★★★★
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Part (a): CREATE TABLE Employee with EmpID INT PRIMARY KEY, Name VARCHAR(30) NOT NULL, Designation VARCHAR(30), Age INT, Salary DECIMAL(8,2).

Part (b): four columns e.g. RollNo INT, SName VARCHAR(30), Physics INT, Maths INT — marks as INT.

Part (a) — creating the Employee table

The data type of each column is chosen to fit the sample rows, and the two stated constraints (EmpID primary key, Name not null) are added:

  • EmpID — whole numbers 101, 102, 103 → INT, marked PRIMARY KEY (unique + non-null).
  • Name — text such as "Smita Kumar" that must always be present → VARCHAR(30) NOT NULL.
  • Designation — job titles like "Programmer II" → VARCHAR(30).
  • Age — small whole numbers → INT.
  • Salary — values like 39500.00 with two decimals → DECIMAL(8,2) (up to 999999.99, precise for money).
CREATE TABLE Employee (
    EmpID INT PRIMARY KEY,
    Name VARCHAR(30) NOT NULL,
    Designation VARCHAR(30),
    Age INT,
    Salary DECIMAL(8,2)
);
``` …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.