Search Header Logo
MY SQL

MY SQL

Assessment

Presentation

Computers

11th - 12th Grade

Practice Problem

Hard

Created by

Saritha Vijayachandran

Used 14+ times

FREE Resource

11 Slides • 21 Questions

1

MY SQL

Slide image

2

Database

  • Organized collection of data

3

Field

Set of characters that are used together to represent specific data elements/ data item. Individual data item within a record is known as a field


RECORD

Collection of fields is termed as record


RELATION

A collection of logically related records is called file/ table/ relation.

4

Database Management System (DBMS)

Software that allows users to define create, access and manage database(s) is termed as Database Eg., MS Access, MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Oracle, SAP, dBASE, Foxpro etc.

5

Database Management System

  • Stores data in structured way

  • Query the database

  • Sort and manipulate the data in database

  • Validate the data entered and check for inconsistencies

  • Produce flexible reports, both on paper and screen

6

Advantages of DBMS

  • Control Data Redundancy

  • Data Consistency

  • Sharing of Data

  • Reduced Programming Effort

  • Database Enforces Standards

  • Improved Data Integrity

  • Privacy and Security

7

Relational Data Model

Data organized in two dimensional tables called relations


RELATIONAL DATABASE

A relational database is a collection of data and items organized as a set of tables from which data can be retrieved easily and efficiently.

8

Attributes

Columns in a database


TUPLE

Each row in a table is known as tuple


Cardinatlity of Relation

Number of records or tuples


Degree of Relation

Number of columns or attributes


Domain of Relation

Set of all possible values that an attribute may contain

9

Primary Key

An attribute or a group of attributes that can uniquely identify tuples within the relation.


CANDIDATE KEY

A candidate key is one that is capable of becoming the primary key


ALTERNATE KEY

Candidate key that is not a primary key


FOREIGN KEY

A non-key attribute whose value(s) are derived from the primary key of some other table is known as foreign key

10

Difference between SQL and MySQL

SQL is a standard language for accessing and manipulating databases. SQL commands are used to create, transform and retrieve information from RDBMS.


MySQL

is an open source and freely available RDBMS that uses SQL.

11

Types of commands

DDL (Data Definition Language) – Create, use, alter, drop

DML (Data Manipulation Language) – Select, insert, update, delete

DCL (Data Control Language)

TCL (Transaction Control Language)

12

Multiple Choice

DML expands to

1

Data Management Language

2

Data Manipulation Language

3

Data Manipulative Language

13

Multiple Choice

In Relational Database Model, a table is also referred to as a

1

tuple

2

attribute

3

relation

4

degree

14

Multiple Choice

The total number of tuples in a relation is referred to as

1

Cardinality of the relation

2

Degree of the relation

3

Cartesian product

4

None of the above

15

Multiple Choice

Set of values from which an attribute takes values from.

1

degree

2

cardinality

3

domain

4

table

16

Multiple Choice

Which of the following statements are invalid?

1

Statement 1 : A relation can have multiple candidate keys

2

Statement 2 : A relation can have multiple primary keys

3

Statement 3 : A relation can have multiple columns with Unique constraint

17

Multiple Choice

Degree of a relation refers to the total number of

1

rows

2

columns

3

tables

4

databases

18

Multiple Choice

Aditi wants to apply a constraint on a table “student” , where in she wants to restrict the marks entered as values between only 1 and 100. Which of the following constraints should she use?

1

Default

2

Check

3

Primary Key

4

Unique

19

Multiple Choice

Which of the following are DDL commands?

1

Create table , Insert into , Drop table

2

Alter table, Update , Drop table

3

Drop table, Alter table, Create table

4

None of the above

20

Multiple Choice

An attribute in a relation is a foreign key if the _______ key from one relation Is used as an attribute in that relation.

1

Candidate

2

Primary

3

Alternate

4

None of the above

21

Multiple Choice

A _________ integrity constraint requires that the values appearing in specified attributes of any tuple in the referencing relation also appear in specified attributes of at least one tuple in the referenced relation.

1

Referential

2

Referencing

3

Primary

4

None of the above

22

Multiple Choice

The primary key must be

1

Unique

2

Not null

3

Both Unique and Not nul

4

Either Unique or Not null

23

Multiple Choice

What is a candidate key in MySQL?

1

Used to identify a column

2

Alias for foreign key

3

Alias for primary key

4

Used to uniquely identify a row

24

Multiple Choice

A table can have

1

One primary key and more than one candidate key

2

One candidate key and one primary key

3

More than one primary, alternate keys

4

One candidate key only.

25

Multiple Choice

Relationship between Primary key (P), Alternate Keys(A), and Candidate keys(C) are:

1

P=A+C

2

C=P+A

3

A=P-C

4

A=P+C

26

Fill in the Blanks

Type answer...

27

Fill in the Blanks

Type answer...

28

Fill in the Blanks

Type answer...

29

Fill in the Blanks

Type answer...

30

Fill in the Blanks

Type answer...

31

Fill in the Blanks

Type answer...

32

Fill in the Blanks

Type answer...

MY SQL

Slide image

Show answer

Auto Play

Slide 1 / 32

SLIDE