SQL Fundamentals

LuxuryMistletoe avatar
LuxuryMistletoe
·
·
Download

Start Quiz

Study Flashcards

22 Questions

What is the purpose of the SQL query 'Alter table Student Add adhrno int;'?

To add a new column 'adhrno' to the Student table

What is the outcome of the SQL query 'Update Student set age=20 where admnno=103;'?

The age of the student with admnno 103 will be updated to 20

What is the effect of the SQL query 'Delete from Student where age<19;'?

Students with age less than 19 will be deleted from the table

What is the purpose of the CREATE command in SQL?

To create a new database object like a table or index

What is the purpose of the SQL query 'Create table Student (admnno int, name varchar (30), course varchar (30), age int);'?

To create a new table named Student with specified columns

Which SQL command is used to add a new record to a database?

INSERT

What is the outcome of the SQL query 'Alter table Student Rename column course to course_name;'?

The column 'course' will be renamed to 'course_name'

What is the purpose of the SQL query 'Select * from Student;'?

To display all columns and rows of the Student table

What is the purpose of the Data Query Language (DQL) in SQL?

To retrieve specific data from a database

What is the purpose of the GRANT command in SQL?

To give a privilege to a user

Which type of SQL statement is used to update an existing database object?

DDL

What is the purpose of theDROP command in SQL?

To delete an entire table, view, or other objects in the database

What is the purpose of the SELECT command in SQL?

To retrieve certain records from one or more tables

Which type of SQL statement is used to control access to databases?

DCL

What is the primary function of SQL queries?

To interact with databases and retrieve data

What is the purpose of constraints in a SQL system?

To ensure data integrity and consistency

What is the name of the language used to create database structures?

Data Definition Language

What is the acronym of the original name given to SQL by IBM?

SEQUEL

What is the role of a database in a SQL system?

To store and manage data efficiently

What is the fundamental building block of a database?

Table

What is the outcome of executing a SQL query?

Retrieval of requested data from the database

Who developed SQL in the 1970s?

IBM Computer Scientists

Study Notes

What is SQL?

  • SQL stands for Structured Query Language and is a standard database language used to access and manipulate data in databases.
  • It was developed by IBM Computer Scientists in the 1970s.

Components of a SQL System

  • Databases: structured collections of data organized into tables, rows, and columns that serve as repositories for storing information efficiently.
  • Tables: fundamental building blocks of a database, consisting of rows (records) and columns (attributes or fields) that ensure data integrity and consistency.
  • Queries: SQL commands used to interact with databases, enabling users to retrieve, update, insert, or delete data from tables.
  • Constraints: rules applied to tables to maintain data integrity, defining conditions that data must meet to be stored in the database.

Functions of SQL

  • Data Definition Language (DDL): SQL commands used to create the database structure.
  • Data manipulation: allows users to add new data, remove data, or modify existing data.
  • Data retrieval: used for retrieving data from databases.
  • Access control: restricts a user's ability to retrieve, add, and modify data, protecting stored data against unauthorized access.
  • Data sharing: coordinates data sharing by concurrent users, ensuring that changes made by one user do not inadvertently wipe out changes made by another user.

SQL Commands

  • CREATE: creates a new table, a view of a table, or other object in the database.
  • ALTER: modifies an existing database object, such as a table.
  • DROP: deletes an entire table, a view of a table, or other objects in the database.
  • SELECT: retrieves certain records from one or more tables.
  • INSERT: creates a record.
  • UPDATE: modifies records.
  • DELETE: deletes records.
  • GRANT: gives a privilege to the user.
  • REVOKE: takes back privileges granted by the user.

Uses of SQL

  • Interacting with databases, including:
    • Data definition: defining the structure and organization of the stored data and the relationships among the stored data items.
    • Data retrieval: retrieving data from databases.
    • Data manipulation: adding new data, removing data, or modifying existing data.
    • Access control: restricting a user's ability to retrieve, add, and modify data.
    • Data sharing: coordinating data sharing by concurrent users.

Learn about the basics of SQL, a standard database language. Discover its components, including databases and tables, and how they store information efficiently.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

SQL Fundamentals Quiz
18 questions

SQL Fundamentals Quiz

EntrancingBaritoneSaxophone avatar
EntrancingBaritoneSaxophone
Database Fundamentals
10 questions
SQL Queries for Data Analytics
18 questions

SQL Queries for Data Analytics

WorldFamousSeaborgium avatar
WorldFamousSeaborgium
SQL Database Management
5 questions

SQL Database Management

AffectionateVuvuzela avatar
AffectionateVuvuzela
Use Quizgecko on...
Browser
Browser