Skip to content

Paper II · Unit 4: Database Management Systems

SQL

SQL is a topic inside Unit 4 (Database Management Systems) of UGC NET Computer Science and Applications, Paper II (code 87). GateIQ has published 40 questions classified under this topic — 14.8% of everything recorded in this unit, and 39 of them carry a written solution.

What this topic covers

Data Definition and Data Types; Constraints, Queries, Insert, Delete, and Update Statements; Views, Stored Procedures and Functions; Database Triggers, SQL Injection

Syllabus wording above is the official heading for this topic; the question counts are GateIQ’s own classification of its published archive.

Try SQL PYQs free

Attempt the 5 most recent published questions on this topic right here, with the published answer and explanation after each check. No account is needed and nothing is saved. Practice tracking and analytics are part of UGC IQ.

0 of 5 checked
  1. 1Previous year question

    A trigger is

    Choose an option to check it.
  2. 2Previous year question

    Read the following and Answer the Questions:
    Consider the relational schema of sailors S\text{S}. Reserves R\mathrm{R} and Boots B\text{B}.

    Table 1: Sailors S\text{S}
    SidSnameRattingAge22Dustin745.029Brutus133.031Lubber855.532Andy825.558Rusty1035.064Horatio735.071Zorba1016.074Horatio935.085Art325.595Bob363.5\begin{array}{|l|l|l|l} \hline Sid & Sname & Ratting & Age \\ \hline 22 & Dustin & 7 & 45.0 \\ 29 & Brutus & 1 & 33.0 \\ 31 & Lubber & 8 & 55.5 \\ 32 & Andy & 8 & 25.5 \\ 58 & Rusty & 10 & 35.0 \\ 64 & Horatio & 7 & 35.0 \\ 71 & Zorba & 10 & 16.0 \\ 74 & Horatio & 9 & 35.0 \\ 85 & Art & 3 & 25.5 \\ 95 & Bob & 3 & 63.5 \\ \hline \end{array}


    Table 2: Reserves R\text{R}

    sidBidday2210110/109822108101098221081018982210410/7983110811/10983110311/6993110411/29864101955864102288587410398958\begin{array}{|l|l|l|} \hline sid & Bid & day \\ \hline 22 & 101 & 10 / 1098 \\ 22 & 108 & 101098 \\ 22 & 108 & 101898 \\ 22 & 104 & 10 / 798 \\ 31 & 108 & 11 / 1098 \\ 31 & 103 & 11 / 699 \\ 31 & 104 & 11 / 298 \\ 64 & 101 & 9558 \\ 64 & 102 & 28858 \\ 74 & 103 & 98958 \\ \hline \end{array}


    Table 3: Boats B\text{B}

    BidBnameColor101Interlakeblue102Interlakered103Clippergreen104Marinered\begin{array}{|l|l|l|} \hline Bid & Bname & Color \\ \hline 101 & Interlake & blue \\ 102 & Interlake & red \\ 103 & Clipper & green \\ 104 & Marine & red \\ \hline \end{array}

    Which of the following relational algebra query/queries computes/compute the sid’s of sailors with age over 20 who have not reserved red boat?

    Choose an option to check it.
  3. 3Previous year question

    Read the following and Answer the Questions:
    Consider the relational schema of sailors S\text{S}. Reserves R\mathrm{R} and Boots B\text{B}.

    Table 1: Sailors S\text{S}
    SidSnameRattingAge22Dustin745.029Brutus133.031Lubber855.532Andy825.558Rusty1035.064Horatio735.071Zorba1016.074Horatio935.085Art325.595Bob363.5\begin{array}{|l|l|l|l} \hline Sid & Sname & Ratting & Age \\ \hline 22 & Dustin & 7 & 45.0 \\ 29 & Brutus & 1 & 33.0 \\ 31 & Lubber & 8 & 55.5 \\ 32 & Andy & 8 & 25.5 \\ 58 & Rusty & 10 & 35.0 \\ 64 & Horatio & 7 & 35.0 \\ 71 & Zorba & 10 & 16.0 \\ 74 & Horatio & 9 & 35.0 \\ 85 & Art & 3 & 25.5 \\ 95 & Bob & 3 & 63.5 \\ \hline \end{array}


    Table 2: Reserves R\text{R}

    sidBidday2210110/109822108101098221081018982210410/7983110811/10983110311/6993110411/29864101955864102288587410398958\begin{array}{|l|l|l|} \hline sid & Bid & day \\ \hline 22 & 101 & 10 / 1098 \\ 22 & 108 & 101098 \\ 22 & 108 & 101898 \\ 22 & 104 & 10 / 798 \\ 31 & 108 & 11 / 1098 \\ 31 & 103 & 11 / 699 \\ 31 & 104 & 11 / 298 \\ 64 & 101 & 9558 \\ 64 & 102 & 28858 \\ 74 & 103 & 98958 \\ \hline \end{array}


    Table 3: Boats B\text{B}

    BidBnameColor101Interlakeblue102Interlakered103Clippergreen104Marinered\begin{array}{|l|l|l|} \hline Bid & Bname & Color \\ \hline 101 & Interlake & blue \\ 102 & Interlake & red \\ 103 & Clipper & green \\ 104 & Marine & red \\ \hline \end{array}

    Which of the following relational algebra query/queries computes/compute the name of sailors who have reserved boat 103?

    Q1\text{Q1} π\pi sname (( $$\delta$$$$_{ bid}$$ = 103_{103} Boats) ⋈\bowtie Sailors)

    Q2\text{Q2} π\pi sname = ( $$\delta$$$$_{ bid}$$ = 103_{103}eserveeserve⋈\bowtie Sailors))

    Q3\text{Q3} π\pi sname = (( $$\delta$$$$_{ bid}$$ = 103_{103} Reserves) ⋈\bowtie Sailors)

    Choose an option to check it.
  4. 4Previous year question

    Consider the following table structures related to a university for the below question.

    EMPLOYEE

        NAME VARCHAR (30) NOT NULL,
        EID VARCHAR (10) NOT NULL,
        DEPTNO INT (5) NOT NULL,
        HODEID VARCHAR (10),
        SALARY INT (10),
    PRIMARY KEY (EID),
    FOREIGN KEY (HODEID) REFERENCES EMPLOYEE (EID),
    FOREIGN KEY (DEPTNO) REFERENCES DEPARTMENT (DID);

    DEPARTMENT

        DID INT (5) NOT NULL,
        DNAME VARCHAR(30) NOT NULL,
        HODID VARCHAR (10) NOT NULL,
        HODNAME VARCHAR (30),
    PRIMARY KEY (DID),
    UNIQUE (DNAME),
    FOREIGN KEY (HODID) REFERENCES EMPLOYEE (EID)

    PROJECT WORK:

        EMPID VARCHAR (10) NOTNULL,
        PROJNO INT(5) NOT NULL,
        PROJECTLOC VARCHAR (30) NOT NULL,
    PRIMARY KEY (EMPID, PROJNO),
    FOREIGN KEY (EMPID) REFERENCES EMPLOYEE (EID),

    On the basis of above given table structures, retrieve the distinct employee ID (EMPID) of all employees of university who are working on project. No. 20,3020, 30 and 40

    Choose an option to check it.
  5. 5Previous year question

    Consider the following table structures related to a university for the below question.

    EMPLOYEE

        NAME VARCHAR (30) NOT NULL,
        EID VARCHAR (10) NOT NULL,
        DEPTNO INT (5) NOT NULL,
        HODEID VARCHAR (10),
        SALARY INT (10),
    PRIMARY KEY (EID),
    FOREIGN KEY (HODEID) REFERENCES EMPLOYEE (EID),
    FOREIGN KEY (DEPTNO) REFERENCES DEPARTMENT (DID);

    DEPARTMENT

        DID INT (5) NOT NULL,
        DNAME VARCHAR(30) NOT NULL,
        HODID VARCHAR (10) NOT NULL,
        HODNAME VARCHAR (30),
    PRIMARY KEY (DID),
    UNIQUE (DNAME),
    FOREIGN KEY (HODID) REFERENCES EMPLOYEE (EID)

    PROJECT WORK:

        EMPID VARCHAR (10) NOTNULL,
        PROJNO INT(5) NOT NULL,
        PROJECTLOC VARCHAR (30) NOT NULL,
    PRIMARY KEY (EMPID, PROJNO),
    FOREIGN KEY (EMPID) REFERENCES EMPLOYEE (EID),

    Given below are two statements to find the sum of salaries of all employees of the English department as well as the maximum, minimum and average salary in English department

    STATEMENT II:

    SELECT SUM (SALARY) MAX(SALARY) MIN(SALARY),
    AVG (SALARY) FROM EMPLOYEE, DEPARTMENT
    WHERE DEPTNO=DID AND DNAME=’ENGLISH’

    STATEMENT IIII:

    SELECT SUM (SALARY), MAX(SALARY), MIN (SALARY),
    AVG (SALARY), FROM EMPLOYEE, DEPARTMENT
    WHERE DNAME=’ENGLISH’

    In the light of the above statements, choose the correct answer from the options given below:

    Choose an option to check it.

35 more questions on SQL

These 5 are free to try without an account. The rest of the published questions on SQL are part of UGC IQ: see what it includes, or create an account to get started.

SQL: questions people ask

How many UGC NET Computer Science questions are asked on SQL?

GateIQ has published 40 UGC NET Computer Science previous year questions on SQL, and 39 of them carry a written solution. That is 14.8% of the questions in Unit 4, Database Management Systems.

Which unit of UGC NET Computer Science Paper 2 is SQL in?

SQL is a topic of Unit 4, Database Management Systems, in Paper II (Computer Science and Applications, code 87).

Can I practise SQL PYQs for free?

Yes. The 5 most recent published questions on this topic are free on this page with no signup, and each shows the published answer with its explanation. The full archive, practice tracking and analytics are part of UGC IQ.

Related topics in Unit 4

Full syllabus · Paper II overview