Search Header Logo
SQL

SQL

Assessment

Presentation

Computers

10th Grade

Medium

Created by

K Parker

Used 46+ times

FREE Resource

14 Slides • 29 Questions

1

SQL

media

2

Introduction

Data, such as a list of names, can be stored in a straightforward text file. But it has some major limitations in terms of searching and sorting the data.​

An alternative to storing data directly in a file is to store it in a database.​

A database is designed specifically to handle, sort, search and manipulate organised data.​

A database is a collection of data or information which is held together in an organised or logical way.​

Because of the high organisation of a database, data can be retrieved, sorted and updated very efficiently.​

3

Multiple Choice

What is a database?

1

something that holds data

2

a program on a computer

3

something that finds data

4

something that sends data

4

SQL

Adding and retrieving information in a database is done using a special-purpose programming language called SQL. 

The basic actions carried out on a database are 

Insert  Update  Delete  Retreive  Sort 

5

Tables

A database is made up of one or more tables. 

Like this: 


Each table should be given a relevant name. The table above is named 'Characters' because it contains well known cartoon or comic characters. 

media

6

Fields

Each column in a table is called a field and contains information about a particular item of data. Each field should be given a relevant name, for instance the field called 'city' contains a city name. A field is always set to a certain data type such as 

numeric types: integer, float, real  boolean  character  string  Date and time  binary  Other e.g. blob 

media

7

Records

A record is made up of collection of fields related to a single item. 

In short: 

Each piece of information is entered into a 'field' 

Related fields are organised into records 

Related records are placed into tables 

Related tables are collected into a database 

media

8

Data types

  • numeric types: integer (whole number), float and real (decimal number) 

  • boolean  - TRUE, FALSE,

  • character  - 1 single character

  • string  - 2 or more characters

9

Multiple Choice

What data type would be the answer to the expression x < 5?
1
Boolean
2
Character
3
Real
4
String

10

Multiple Choice

What data type would be best used to record an email address?
1
String
2
Integer
3
Real
4
Character

11

Multiple Choice

Integers cannot store negative numbers.
1
False
2
True

12

Multiple Choice

What data type would be best to record the exact length of a piece of string in meters?
1
Real
2
Boolean
3
Decimal
4
Integer

13

Multiple Choice

What data type would be best used to record the number of people at a party?
1
Integer
2
Real
3
String
4
Boolean

14

Multiple Choice

In a database, all the information about one person or thing is called a

1

Worksheet

2

Presentation

3

Record

4

File

15

Multiple Choice

In a database, data is stored in

1

Queries

2

Forms

3

Reports

4

Tables

16

Multiple Choice

The best data type to choose for a memberID would be

1

Number

2

Date/Time

3

String

4

Currency

17

Multiple Choice

The best data type to choose for date of birth would be

1

Number

2

Date/Time

3

Text

4

Currency

18

Multiple Choice

In a TABLE, a row is known as a...

1

Information

2

Column

3

Data

4

Record

19

Multiple Choice

In a TABLE, a column is known as a...

1

Record

2

Field

3

Row

4

Data

20

Multiple Choice

Which of these holds lots of data?

1

Record

2

Field

3

Table

4

Drawing

21

SQL

Short for 'Structured Query Language'. 

SQL was created for use with an SQL database. It consists of a set of commands that can carry out the following tasks 

Search records, Update records,   Insert records , Delete records , Find related records

SQL commands 

SELECT This retrieves a record or a set of records. Other commands can then be carried out on that record set without affecting the whole database. 

FROM The identifies the table where the data comes from 

WHERE This sets out some condition with which to choose only certain records 

22

Using SELECT

  • This is a command to retrieve records from a database table. It doesn't do anything to the record itself. But it is very useful because by selecting a record, other commands can be carried out on just the selected records without affecting the rest of the database. 

  • If we wanted to retrieve every record from this table, the SELECT command is:- 
             SELECT * FROM Characters 
    The asterisk * is called a 'wildcard' and it means 'all records' or 'all fields'. The FROM is followed by the name of the table

media

23

SELECT

  • If we wanted to fetch all fields from within a specific record then the wildcard is useful, e.g if we wanted all fields from the Donald Duck record the SELECT statement is 

         SELECT * FROM Characters WHERE First Name = "Donald"  

  • The SELECT command is also used to fetch fields from within a record set. e.g

     SELECT Address, City FROM Characters WHERE First Name = "Donald"

media

24

Multiple Choice

How would you display Chairs in the Items table that have a Price greater than £50.

1

SELECT * FROM Items WHERE Type = 'Chair' AND Price > 50

2

SELECT * FROM Items WHERE Type = 'Chair' OR Price < 100

3

SELECT * FROM Iterms WHERE Type = 'Chair' AND Price >= 50

4

SELECT * FROM Items WHERE Price > 50

25

Multiple Choice

How would we script a SQL query to select "Description" from the Item table?

1

SELECT Item.Description

2

EXTRACT Description FROM Item

3

SELECT Item FROM Description

4

SELECT Description FROM Item

26

Multiple Choice

How do we select all rows for the "Designer" table?

1

SELECT * FROM Designer

2

SELECT [All] FROM Designer

3

SELECT Designer.*

4

SELECT FROM Designer

27

Multiple Choice

What is the correct order of clauses in a SQL statement?

1

SELECT, FROM, ORDER BY, WHERE

2

SELECT, FROM, WHERE, ORDER BY

3

SELECT, WHERE, FROM, ORDER BY

4

WHERE, FROM, SELECT, ORDER BY

28

Multiple Choice

Which character returns all the data found in a table?

1

%

2

#

3

*

4

/

29

Multiple Choice

Which word is missing from the following SQL statement?


Select * table_name

1

With

2

Where

3

From

4

And

30

Multiple Choice

Using which word allows you to specify that only one of a series of conditions needs to be met in a query filter?

1

And

2

Maybe

3

If

4

Or

31

Multiple Choice

Using which word allows you to specify that more than one condition must be met in a query?

1

Also

2

And

3

Or

4

Where

32

Multiple Choice

If you were wanting to filter data, which clause would you use?

1

Where

2

Order by

3

From

4

Select

33

Multiple Choice

Which statement is used to extract data from a database?

1

Extract

2

Get

3

Open

4

Select

34

Multiple Choice

What does "SQL" stand for?

1

Structured Question Language

2

Structured Query Language

3

Simple Query Language

4

Simple Question Language

35

Using SELECT .... WHERE

  • This is a command to select only certain records from a database table. 

    Table name: Characters 

  • The general format of the SELECT ... WHERE command is :- 

    SELECT fields FROM table WHERE Criteria 

media

36

SELECT, WHERE

Or, without the labels: 

SELECT FirstName, LastName FROM Characters

 WHERE City = 'Anaheim' 

FirstName and LastName are fields (columns) within the table Characters. 

This SQL command will return the first and last names of anyone in the table whose city is Anaheim. In this case, there are two matches: 

Mickey Mouse  Arnold Mouse 

media

37

Operators

  • The standard set of arithmetic comparators can be used in the criteria (=, >, <., >=, <=, !=). For example Age < 60 would get all records with an age of less than 60. 

38

Open Ended

Question image

State the most appropriate data type used to store Age

39

Open Ended

Question image

State the most appropriate data type used to store City

40

Open Ended

Question image

Type an SQL statement to select the First Name field for all records that have an Age greater than 50

41

Open Ended

Question image

How many records would appear in the result of the SQL statement to select the First Name field for all records that have an Age greater than 50

42

Open Ended

What does the wildcard (*) do?

43

SQL

media

Show answer

Auto Play

Slide 1 / 43

SLIDE