Search Header Logo

Quiz 2 Intro to Database

Authored by Güray ARIK

Computers

1st Grade

Quiz 2 Intro to Database
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which one is NOT a domain type/data type in SQL?

char

varchar

numeric

class

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which command is CORRECT for creating a table?

create table instructor ( ID char(5), name varchar(20), dept_name varchar(20), salary numeric(8,2))

insert into table instructor ( ID char(5), name varchar(20), dept_name varchar(20), salary numeric(8,2))

create database instructor ( ID char(5), name varchar(20), dept_name varchar(20), salary numeric(8,2))

alter table instructor ( ID char(5), name varchar(20), dept_name varchar(20), salary numeric(8,2))

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

insert into instructor values ('10211', 'Smith', 'Biology', 66000);

What does this command?

inserts a new value to instructor table

updates instructor table with new value

inserts a new value to instructor database

changes the value of id 10211

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

I want to find the names of all instructors whose name INCLUDES the substring “dar”

Which one is CORRECT select query?

select name from instructor where name = '%dar%'

select name from instructor where name like 'dar%'

select name from instructor where name like '%dar%'

select name from instructor where name in '%dar%'

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

I want to list in alphabetic order the salary of all instructors with highest to smallest.

Which select query is CORRECT?

select * from instructor order by salary asc

select * from instructor order by salary desc

select * from instructor order by salary

select * from instructor where order by max

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Find the total number of instructors who teach a course in the Spring 2018 semester

select count (*) from teaches where semester = 'Spring' and year = 2018;

select max(distinct ID) from teaches where semester = 'Spring' and year = 2018;

select Id from teaches where semester = 'Spring' and year = 2018;

select avg(*) from teaches where semester = 'Spring' and year = 2018;

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

select dept_name, avg (salary) as avg_salary from instructor

group by dept_name

having avg (salary) > 40000;

What does this query do?

Find the department names and total salaries of all departments whose average salary is greater than 40000

Find the department names and average salaries of all departments whose average salary is greater than 40000

it gives error

Find the salaries of all departments whose average salary is smaller than 40000

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?