Introduction to SQL: DDL, DML, DCL, and TCL
10 Questions
3 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does DDL stand for in the context of SQL?

  • Data Decision Language
  • Data Description Language
  • Data Definition Language (correct)
  • Data Destructive Language
  • Which command is used to permanently remove a table from the database in SQL?

  • Delete
  • Erase
  • Remove
  • Truncate (correct)
  • What does DML stand for in the context of SQL?

  • Data Mapping Language
  • Data Manipulation Language (correct)
  • Data Modification Language
  • Data Modeling Language
  • Which SQL command is used to make changes to an existing table structure?

    <p>Alter</p> Signup and view all the answers

    In SQL, which keyword is used to specify the conditions for selecting rows from a table?

    <p>WHERE</p> Signup and view all the answers

    What is the purpose of the SQL query 'Select * From Employees Where Not Nationality = ‘Egyptian’ ;'?

    <p>To select all employees whose nationality is not Egyptian</p> Signup and view all the answers

    What does the SQL query 'Select * From Employees Where Emp_Name Like ‘A%’ ;' do?

    <p>Selects employees whose names start with the letter 'A'</p> Signup and view all the answers

    What does the SQL query 'Select * From Employees Where Emp_Name Like ‘Z%B’ ;' retrieve?

    <p>Employees with names starting with 'Z' and ending with 'B'</p> Signup and view all the answers

    What is the outcome of the SQL query 'Select Max (Salary) as Max , Min (Salary) as Min , Avg (Salary) as Average From Employees ;'?

    <p>Maximum, minimum, and average salary of all employees</p> Signup and view all the answers

    What does the SQL query 'Select Distinct (FUN) as Functions From Employees ;' do?

    <p>Retrieves distinct values of the column 'FUN' from Employees table</p> Signup and view all the answers

    Study Notes

    SQL Fundamentals

    • DDL stands for Data Definition Language, used to create and modify database structures.

    SQL Commands

    • The DROP command is used to permanently remove a table from the database.

    SQL Fundamentals

    • DML stands for Data Manipulation Language, used to perform operations on data in a database.

    SQL Commands

    • The ALTER command is used to make changes to an existing table structure.

    SQL Queries

    • The WHERE keyword is used to specify the conditions for selecting rows from a table.

    SQL Queries

    • The SQL query 'Select * From Employees Where Not Nationality = ‘Egyptian’ ;' selects all rows from the Employees table where the Nationality is not 'Egyptian'.

    SQL Queries

    • The SQL query 'Select * From Employees Where Emp_Name Like ‘A%’ ;' selects all rows from the Employees table where the Emp_Name starts with the letter 'A'.

    SQL Queries

    • The SQL query 'Select * From Employees Where Emp_Name Like ‘Z%B’ ;' retrieves all rows from the Employees table where the Emp_Name starts with 'Z' and has 'B' in it.

    SQL Queries

    • The SQL query 'Select Max (Salary) as Max , Min (Salary) as Min , Avg (Salary) as Average From Employees ;' retrieves the maximum, minimum, and average salary from the Employees table.

    SQL Queries

    • The SQL query 'Select Distinct (FUN) as Functions From Employees ;' retrieves unique values from the FUN column (representing functions) in the Employees table.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    This quiz covers the basics of SQL (Structure Query Language) including its data definition, manipulation, control, and transaction control capabilities. Topics include creating, dropping, altering tables, inserting, updating, and deleting data, as well as granting and revoking permissions.

    More Like This

    Use Quizgecko on...
    Browser
    Browser