Self Studies

Computer Science Test - 7

Result Self Studies

Computer Science Test - 7
  • Score

    -

    out of -
  • Rank

    -

    out of -
TIME Taken - -
Self Studies

SHARING IS CARING

If our Website helped you a little, then kindly spread our voice using Social Networks. Spread our word to your readers, friends, teachers, students & all those close ones who deserve to know what you know now.

Self Studies Self Studies
Weekly Quiz Competition
  • Question 1
    5 / -1
    What SQL structure is used to limit column values of a table ?
    Solution

    The correct answer is option 2.

    Concept:

    The CHECK constraint is used to restrict the range of values that may be entered into a column. When we define a CHECK constraint on a column, only particular values are allowed for that column.

    • When a table has a CHECK constraint, it might limit the values in specific columns based on the values in other columns in the row.
    • A check constraint is a rule that specifies the permissible values in one or more columns of each row of a base table.

    Example:

    The following SQL creates a CHECK constraint on the "Age" column when the "student" table is created. The CHECK constraint ensures that the age of a student must be 18, or older:

    CREATE TABLE student (

    ID int NOT NULL,

    LastName varchar(255) NOT NULL,

    FirstName varchar(255),

    Age int, CHECK (Age>=18) );

    Hence the correct answer is the CHECK constraint.

  • Question 2
    5 / -1
    A clause in SQL allows you to rename a table or a column temporarily by giving another name known as alias. The renaming is a temporary change and the actual table name does not change in the database. Which of the following clauses, allows such option?
    Solution

    The correct answer is option 3.

    Concept:

    In SQL, we can temporarily rename a table or a column by giving it another name known as Alias. Table aliases are used to rename a table in a specific SQL statement. The renaming is only a temporary change, and the actual table name in the database remains unchanged.

    Syntax: The following is the basic syntax for a table alias.

    SELECT column1, column2....

    FROM table_name AS alias_name

    WHERE [condition];

    Syntax: The following is the basic syntax for a column alias.

    SELECT column_name AS alias_name
    FROM table_name
    WHERE [condition];
    Hence the correct answer is AS.
  • Question 3
    5 / -1

    Consider the following EMP table and answer the question below.

    EMP_NO

    SALARY

    GRADE

    E001

    1000

    E1

    E002

    2000

    E4

    E003

    1500

    E2

    E004

    4000

    E4

     

     

     

     

     

     




    Which of the following select statement should be executed if we need to display the average salary of employees who belong to grade "E4"?

    Solution

    The correct answer is "option 4".

    CONCEPT:

    GROUP BY clause: The GROUP BY clause in SQL is used to group the rows having the same values.

    HAVING clause: HAVING clause in SQL is used instead of WHERE with an aggregate function.

    EXPLANATION:

    Here, 

    Group by grade will produce the following table:

    EMP_NO

    SALARY

    GRADE

    E001

    1000

    E1

    E003

    1500

    E2

    E002

    2000

    E4

    E004

    4000

    E4

    The SQL query "select avg(salary) from EMP group by grade having grade="E4" " will produce the output average salary of employees who belong to grade "E4".

    Final output:

    SALARY

    6000

    Hence, the correct answer is "option 4".

  • Question 4
    5 / -1
    MySQL is examples of
    Solution

    Relational Data Base:

    • A relational database is a collection of data items with pre-defined relationships between them.
    • These items are organized as a set of tables with columns and rows.
    • Tables are used to hold information about the objects to be represented in the database.
    • Each column in a table holds a certain kind of data and a field stores the actual value of an attribute.
    • The rows in the table represent a collection of related values of one object or entity.
    • Each row in a table could be marked with a unique identifier called a primary key, and rows among multiple tables can be made related using foreign keys.
    • This data can be accessed in many different ways without reorganizing the database tables themselves.
    • Examples: Popular examples of standard relational databases include Microsoft Access, Microsoft SQL Server, Oracle Database, MySQL, and IBM DB2. Cloud relational databases include Amazon Relational Database Service (RDS), Google Cloud SQL, IBM DB2 on Cloud, SQL Azure, and Oracle Cloud.
  • Question 5
    5 / -1

    Consider the following SQL query to retrieve ecode of employees from STUDENT table, whose address contains 'MUMBAI':

    SELECT ecode

    FROM STUDENT

    WHERE _________;

    Which of the following is most suitable to complete the query?

    Solution

    Concept:

    • LIKE operator is used in a WHERE clause to search for a specified pattern in a column. 
    • There are two wildcards often used in conjunction with the LIKE operator:

    Character

    Description

    % (percentage)

    The percent sign represents zero, one, or multiple characters

    _ (underscore)

    The underscore represents a single character 

    Syntax:

    SELECT column_name1, column_name2 ... FROM table_name

    WHERE  column_name LIKE '%Match'

    OR

    SELECT column_name1, column_name2 ... FROM table_name

    WHERE  column_name LIKE '%Match%'

    SQL command

    SELECT ecode

    FROM STUDENT

    WHERE address LIKE '%MUMBAI%'

    Return ecode from STUDENT table whose address part contains "INDIA" in any position.

    NOTE:

    address is a column in STUDENT table

  • Question 6
    5 / -1
     With SQL, how can you return the number of records in the "persons" table? 
    Solution

    Concept:

    SQL stands for the structured query language. It is used to perform operations like creating, inserting, deleting and modifying the data in the database.

    Explanation:

    SQL count function:

    It is used to count the number of records in the selected table. It is used with the SELECT statement.

    Syntax: SELECT count(*) FROM table_name

    Here  table_name is given as persons.

    So, the number of records in the "persons" table can find out as :

    SELECT count(*) FROM persons;

  • Question 7
    5 / -1
    The value of each NULL is __________.
    Solution

    Answer: Option 2

    Explanation

    • A null value in a table is a value in a field that appears to be blank. A field with a Null value is a field with no value.
    • A value of NULL indicates that the value is unknown. A value of NULL is different from an empty or zero value.
    • No two null values are equal. Comparisons between two null values, or between a NULL and any other value, return unknown because the value of each NULL is unknown.
  • Question 8
    5 / -1

    If the increment is in thousand then what is the average Increment for the below-given SQL query?

    SELECT AVG(Increment)  FROM Employee

    Employee

    ID

    Increment

    1

    18

    2

    16

    3

    17

    4

    null

    5

    17

    6

    null

    7

    null

    812
    Solution

    Since increment containing null value is ignored

    Average = \(\frac{{18 + 16 + 17 + 17 +12\;}}{5} = 16\)

    Average = 16

    Important Points Tuple with null value is ignored and hence it is not included in the final calculation.

  • Question 9
    5 / -1
    Expansion of RDBMS is ________.
    Solution

    The correct answer is Relational Database Management System

    Additional Information 

    • Expansion of RDBMS is Relational Database Management System.
    • It is a database management system which is based on the relational model.
    • It was invented by E. F. Codd, in 1970.
    • It is a set of programs which has all the features of DBMS (Database Management System) and it also helps to establish connections between tables.
    • This software allows application systems to focus on the user interface, data validation, and screen navigation.

    MySQL is an example of RDBMS.

  • Question 10
    5 / -1
    Which of the following is used to manage Data Base ?
    Solution

    The correct answer is DBMS.

    Key Points

    • A Database is an organized collection of data so that it can be easily accessed and managed.
    • DBMS stands for Database Management System.
    • A Database Management System (DBMS) is software designed to store, retrieve, define, and manage data in a database.
    • Database Management System removes redundancy and Integrity.
    • Database Management System reduces Application Development Time.
    • DBMS follows the concepts of Atomicity, Consistency, Isolation, and Durability (normally shortened as ACID).
    • DBMS supports a multi-user environment and allows them to access and manipulate data in parallel. 
    • Types of DBMS Systems are:
      • Hierarchical Database
      • Network Database
      • Relational Database
      • Object-Oriented Database
    • The three-schema architecture of DBMS:

    • Some popular DBMS systems:
      • MySQL
      • Microsoft Access
      • Oracle
      • LibreOffice Base
      • Microsoft SQL Server

    Important Points 

    • In 1960, Charles Bachman designed the first DBMS system.
    • In 1970, Codd introduced IBM'S Information Management System (IMS)
    • In 1976, Peter Chen coined and defined the Entity-relationship model also know as the ER model.
    • In 1991, Microsoft ships MS Access, a personal DBMS and that displaces all other personal DBMS products.

    ​​​​Additional Information 

    • Operating System
      • ​An operating system acts as an intermediary between the user of a computer and computer hardware.
      • Operating systems were first developed in the late 1950s to manage tape storage.
      • The General Motors Research Lab implemented the first OS in the early 1950s for their IBM 701.
      • Operating System allows disk access and file systems Device drivers Networking Security.
      • Operating System Handling I/O operations.
      • Operating System has error detection and handling technic.
      • An Operating System is concerned with the allocation of resources and services, such as memory, processors, devices, and information. 
      • The Kernel is the central component of a computer operating system.
    • ​Compiler
      • The compiler translates source code written in a high-level language into a set of machine-language.
      • Compilers are very large programs, with error-checking and other abilities.
      • The object code is machine code that the processor can perform one instruction at a time.
      • The first Autocode and compiler in the modern sense were developed by Alick Glennie in 1952.
      • John W. Backus at IBM introduced the first commercially available compiler, in 1957.
Self Studies
User
Question Analysis
  • Correct -

  • Wrong -

  • Skipped -

My Perfomance
  • Score

    -

    out of -
  • Rank

    -

    out of -
Re-Attempt Weekly Quiz Competition
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now