Search Header Logo
Structured Query Language

Structured Query Language

Assessment

Presentation

Computers

9th - 10th Grade

Practice Problem

Easy

Created by

Ryan Mordey

Used 11+ times

FREE Resource

9 Slides • 9 Questions

1

Structured Query Language (SQL)

Mr Mordey

2

Big Picture

Described how sub routines are used in programming.

Past

Describe how SQL is used throughout programming and accessing databases.

Develop code that makes use of SQL procedures

Present

Future

Careers: HTML Developer, Database Manager.

3

Multiple Choice

What is a sub routine?

1
A subroutine is a method for storing data.
2
A subroutine is a graphical user interface element.
3
A subroutine is a type of variable.
4

A subroutine is a small chunk of contained within a larger program.

4

Multiple Choice

What is the difference between a function and procedure?

1
A function is always faster than a procedure.
2
Procedures can return multiple values, while functions cannot.
3
Functions are used only for mathematical calculations, whereas procedures are not.
4
The main difference is that a function returns a value, whereas a procedure does not.

5

media

SQL stands for structured query language. This is a specific programming language to search for data in a database.

Databases can have thousands of records so SQL allows us to search for data in a more efficient manner so it can be returned in a program.

SQL

6

A database is made up of fields and records.

A record contains different data about a single product/person and goes across in the table. Each record is uniquely identified by a primary key. A record is unique.

A field is a piece of information that is stored for each record, this goes down in the table. A field is not unique.

Database Structure

media

​Records

7

Multiple Choice

What is the purpose of SQL?

1
To write and compile programming languages.
2

The purpose of SQL is to manage search, and manipulate databases.

3
To create and design websites.
4
To manage and manipulate spreadsheets.

8

Labelling

Label the database features

Drag labels to their correct position on the image

Container

Secondary Key

Data

Record

Field

Primary Key

9

Searching For Data

Databases store huge amounts of information. SQL allows us to easily search for data from each table using the SELECT command, lets use this table as an example:

media
  • SELECT MovieName FROM movies would return all movies from the table

  • SELECT MovieName, Rating FROM movies would return all movies and their rating from the table

  • SELCECT * FROM movies would return all records from the table

10

Filtering Data

We can filter the data down using the WHERE command to only show certain information using conditions, we will still use this table:

media
  • SELECT * FROM movies WHERE rating >= 7 would return the following data:

media

11

Multiple Choice

What is the purpose of the * command when searching for records in SQL?

1
The * command is used to delete records in SQL.
2
The * command limits the number of records returned in a SQL query.
3
The * command updates specific columns in a SQL query.
4

The * command returns all records in a SQL query.

12

Drag and Drop

Question image
Complete the code below so that only Star Wars and the Director are returned.



MovieName, ​
FROM ​
rating ​
Drag these tiles and drop them in the correct blank above
SELECT
Director
WHERE
<6
movies
>6
HIGHLIGHT
GET
MovieID
WHEN

13

Filtering Data with operators

We can also use Boolean operators to select multiple fields to filter data from.

media
  • SELECT Director FROM movies WHERE rating >=7 AND age = 12 would return the following data:

media
  • SELECT * FROM movies WHERE rating >= 5 AND age = "PG" would return the following data:

media

14

WildCards

We can use Wildcards so search for patterns in data using the WHERE and LIKE command:

  • SELECT director FROM movies WHERE MovieName LIKE "%World" would return the following data:

  • SELECT * FROM movies WHERE MovieName LIKE "%End" would return the following data:

media
media
media

15

Multiple Choice

How are Boolean operators used in SQL?

1

Boolean operators in SQL are used to filter multiple fields.

2
Boolean operators are used to sort results in SQL.
3
Boolean operators are only applicable in programming languages, not SQL.
4
Boolean operators are used to create tables in SQL.

16

Multiple Choice

What is the purpose of the Like "% " wildcard in SQL

1

To only return records that include symbols.

2

To remove data from a record.

3

To convert all records into a percentage.

4

To return data with the pattern outlined in the condition.

17

Open Ended

Question image

Write SQL code to return all records contain the letters "end" in the movie name

18

Main Task

Computer Task:

Add to your exam reference language programming guide in Publisher.

You should include information about SQL including an example.

You should include the definition of SQL, why we use SQL and examples of code to create a database and search for data.

Complete all the questions on the work sheet.

Structured Query Language (SQL)

Mr Mordey

Show answer

Auto Play

Slide 1 / 18

SLIDE