wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL exam 2

Total questions: 25

Worksheet time: 39mins

Name
Class
Date
1.

Hansı bənd əsas SQL sorğu strukturunun bir hissəsi deyil?

a)

Select

b)

Where

c)

Contains

d)

From

2.

Hər bir sütunun data tipi nə vaxt müəyyən edilir?

a)

Cədvəlin yaradılması zamanı

b)

Cədvələ məlumat daxil edildikdən sonra

c)

Məlumatların silinməsindən sonra

d)

Cədvəlin yüklənilməsi zamanı

3.

Onluq nöqtədən əvvəl və sonra 3 ədəd dəqiqliyi ilə onluq dəyəri saxlamaq üçün hansı SQL məlumat növündən istifadə edilməlidir?

a)

Varchar2(3)

b)

Varchar(3,3)

c)

Number(3,3)

d)

Number(3)

4.

DDL(data definition language) əmri deyil

a)

Create

b)

Alter

c)

Truncate

d)

Insert

5.

__ bir və ya bir neçə sütundan ibarətdir və ən əsas saxlama vahidini təmsil edir.

a)

Cədvəl

b)

Sıra

c)

Sütun

d)

Verilənlər bazası

6.

Hansı SQL ifadəsi Employees cədvəlindəki bütün qeydlər üçün yalnız name və salary sütunlarını alır?

a)

SELECT * FROM Employees

b)

SELECT Name, Salary FROM Employees

c)

FROM Employees SELECT Name, Salary

d)

SELECT .Name, .Salary FROM Employees

7.

Students cədvəli hansı variantda doğru yaradılıb?

a)

create table students (

s_name varchar2(15),

s_surname char(15),

gpa number);

b)

create students (

s_name varchar2(15),

s_surname char(15),

gpa number);

c)

create table students (

s_name varchar2,

s_surname char(15),

gpa number);

d)

students create table (

s_name varchar2,

s_surname char(15),

gpa number);

8.

Doğru "subquery" vasitəsilə yaradılmış cədvəl hansıdır?

a)

create table students_archive select * from students;

b)

create table students_archive as select * from students;

c)

create table students_archive as select students;

d)

create students_archive select * from students;

9.

Students cədvəlinə age sütununu əlavə edən doğru sorğunu tapın.

a)

alter table students

add (age number);

b)

alter table students

modify (age number);

c)

alter students

add (age number);

d)

alter students

drop (age number);

10.

Person cədvəlini oxuma və yazma rejiminə salan sorğunu tapın

a)

alter table Person read write only;

b)

alter table Person read write;

c)

alter table Person read only;

d)

alter Person read write;

11.

Hansı sorğu səhvdir?(birdən cox variant seçimi)

a)

alter table Person read write only;

b)

alter table Students rename to Telebe;

c)

drop table Student purge;

d)

alter Students

drop (age);

e)

alter table Students

drop (age);

12.

Spesfik sütunlara dəyərlər hansı sorğu ilə verilir?

a)

insert into students values(2,'Ilkin','Memmedov');

b)

insert into students values(null,'Abbas','Abbasli');

c)

insert into students (id,ad) values (3,'Eli');

d)

insert into students1 values(&id,'&ad','&soyad');

13.

Students cədvəlində id-si 1 olan şəxsin adını Elvin kimi dəyişən sorğunu tapın.

a)

update Students

name='Elvin' where id=1;

b)

update Students set id=1 where name='Elvin';

c)

update Students set name='Elvin' where id=1;

d)

update Students set name='Elvin' where id=2;

14.

Persons cədvəlindən id-si 15 ə bərabər olan şəxsin melumatlarını silən sorğu hansıdır?

a)

Delete Persons where id=15

b)

Delete Persons where id:15

c)

Alter drop Persons where id=15

d)

Drop Persons where id=15

15.

Hansı DML əmridir?

a)

Delete

b)

Drop

c)

Alter

d)

Create

16.

Biri məhdudlaşdırıcı deyil

a)

Null

b)

Unique

c)

Check

d)

Primary key

e)

Not null

17.

Səhv sorğunu tapın.

a)

create table student(

name varchar2(10),

surname varchar2(15),

constraint pk_name_surname primary key (name,surname)

);

b)

create table student(

name varchar2(10),

surname char(10),

constraint null_name_sur

not null (name,surname));

c)

create table students(

id number,

constraint check_id check (id>10)

);

d)

create table department(

id number CONSTRAINT pk_id PRIMARY key,

dep_name VARCHAR2(20) not null

);

18.

SQL ilə "FirstName" sütununun dəyərinin "Peter" olduğu "Persons" adlı cədvəldən bütün qeydləri necə seçə bilərsiniz?

a)

Select * from Persons where firstname='Peter'

b)

Select all from Persons where firstname='Peter'

c)

Select * from Persons where lastname='Peter'

d)

Select * from Persons firstname='Peter'

19.

Oracle verilənlər bazası parametrlərində hərf həssaslığı ilə bağlı hansı ifadə doğrudur?

a)

SELECT, FROM və WHERE kimi SQL bəndləri böyük hərflərə həssasdır

b)

Oracle verilənlər bazasında SQL dili həmişə hərflərə həssasdır.

c)

Sətir dəyərlərinə əsaslanan filtrləmə zamanı hərf həssaslığı vacibdir.

d)

Oracle-da cədvəl adları böyük hərflərə həssasdır

20.

SQL ilə "Persons" cədvəlinə yeni qeydi necə daxil etmək olar?

a)

INSERT ('Jimmy', 'Jackson') INTO Persons

b)

INSERT INTO Persons VALUES ('Jimmy', 'Jackson')  

c)

INSERT VALUES ('Jimmy', 'Jackson') INTO Persons

d)

INSERT INTO Persons VALUES (Jimmy, Jackson)  

21.

SQL ilə "Persons" cədvəlində "LastName" olaraq "Olsen"i necə daxil edə bilərsiniz?

a)

INSERT INTO Persons (LastName) VALUES (Olsen)

b)

INSERT INTO Persons ('Olsen') INTO LastName

c)

INSERT INTO Persons (LastName) VALUES ('Olsen') 

d)

INSERT ('Olsen') INTO Persons (LastName)

22.

NOT NULL məhdudiyyəti NULL dəyərləri qəbul etməmək üçün sütunu məcbur edir.

a)

Doğru

b)

Səhv

c)

Qismən səhv

d)

Qismən doğru

23.

"Students_Old" cədvəlinin əsasında bütün məlumatları "Students_New" -ə daxil edir?

a)

insert into Students_New select * from Students_Old;

b)

insert into Students_New as select * from Students_Old;

c)

insert Students_New select * from Students_Old;

d)

insert into Students_New as select all from Students_Old;

e)

insert into Students_New select all from Students_Old;

24.

Implicit formada "NULL" dəyərlər verən sorğunu tapın?

a)

insert into Students

(id) values (4);

b)

insert into students values(null,'Abbas','Abbasli');

c)

insert Students

(id) values (4);

d)

insert students values

into(null,'Abbas','Abbasli');

25.

“Lesson” və “Teacher” cədvəlləri qurun və müvafiq məhdudlaşdırıcılar (sütün səviyyəsində) tətbiq edin. (Lesson_id, Teacher_id sütunları əsas açardır, Lesson_name, Teaher_name ,Teaher_surname sütunları  “NULL” dəyərlər qəbul edə bilməz, Teacher_age sütunu yalnız 22-dən yuxarı qiymətlər əldə edə bilər, L_Teacher_id sütunu xarici açardır və Teacher cədvəlinin “Teacher_id”  sütunu ilə bağlılıq təşkil edir. Bu bağlılığı yaradarkən parent cədvəlindəki məlumatı sildikdə child cədvəlindən silməyə icazə verməsini və eyni zamanda silinən sütununa null dəyər verməsini şərtini əlavə edin.(hər bir məhdudlaşdırıcıya ad verin)

4 lines