SYS 1591

Quiz
•
Computers
•
University
•
Medium
Ade Maulana
Used 4+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Berikut adalah struktur tabel employees. Anda ingin menampilkan nama-nama karyawan yang memiliki gaji lebih tinggi dari rata-rata gaji di departemen mereka. Pilih kueri yang tepat:
SELECT name
FROM employees
WHERE salary > AVG(salary);
SELECT name
FROM employees
WHERE salary > (SELECT AVG(salary) FROM employees);
SELECT name
FROM employees
HAVING salary > AVG(salary);
SELECT name
FROM employees
WHERE salary > (SELECT AVG(salary) FROM employees WHERE department = employees.department);
2.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Berikut adalah struktur tabel orders. Anda ingin menampilkan total jumlah pesanan yang dilakukan oleh setiap pelanggan pada tanggal tertentu. Pilih kueri yang tepat:
SELECT customer_id, SUM(total_amount)
FROM orders
WHERE order_date = '2024-04-16';
SELECT customer_id, SUM(total_amount)
FROM orders
GROUP BY customer_id
WHERE order_date = '2024-04-16';
SELECT customer_id, SUM(total_amount)
FROM orders
WHERE order_date = '2024-04-16'
GROUP BY customer_id;
SELECT customer_id, SUM(total_amount)
FROM orders
WHERE order_date = '2024-04-16'
ORDER BY customer_id;
3.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Anda ingin menampilkan nama-nama karyawan yang memiliki gaji lebih tinggi dari gaji rata-rata seluruh karyawan di perusahaan. Pilih kueri yang tepat:
SELECT name
FROM employees
WHERE salary > AVG(salary);
SELECT name
FROM employees
WHERE salary > (SELECT AVG(salary) FROM employees);
SELECT name
FROM employees
HAVING salary > AVG(salary);
SELECT name
FROM employees
WHERE salary > (SELECT AVG(salary) FROM employees WHERE department = employees.department);
4.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Manakah pernyataan di bawah ini yang merupakan contoh DDL (Data Definition Language)?
SELECT * FROM employees;
CREATE TABLE customers (id INT PRIMARY KEY, name VARCHAR(50));
UPDATE employees SET salary = salary * 1.1 WHERE department = 'Sales';
ALTER TABLE orders ADD COLUMN order_date DATE;
5.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Manakah pernyataan di bawah ini yang merupakan contoh DML (Data Manipulation Language)?
INSERT INTO products (name, price) VALUES ('Keyboard', 25.00);
DROP TABLE customers;
ALTER TABLE employees ADD COLUMN email VARCHAR(100);
CREATE INDEX idx_name ON employees (name);
6.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Apa pernyataan yang benar tentang DDL dan DML dalam MySQL?
DDL digunakan untuk memanipulasi data dalam tabel, sedangkan DML digunakan untuk mendefinisikan struktur database.
DDL digunakan untuk menambahkan, menghapus, atau memperbarui data dalam tabel, sedangkan DML digunakan untuk membuat atau mengubah struktur tabel.
DDL digunakan untuk membuat, mengubah, atau menghapus tabel atau struktur database, sedangkan DML digunakan untuk menambah, menghapus, atau memperbarui data dalam tabel.
DDL dan DML dapat digunakan secara bergantian dalam MySQL tanpa perbedaan yang jelas antara keduanya.
7.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Bagaimana sintaks yang benar untuk menambahkan referensi ke tabel lain menggunakan ALTER TABLE di MySQL?
ALTER TABLE table_name
ADD CONSTRAINT constraint_name FOREIGN KEY (column_name)
REFERENCES referenced_table(column_name);
ALTER TABLE table_name
ADD COLUMN column_name FOREIGN KEY
REFERENCES referenced_table(column_name);
ALTER TABLE table_name
ADD FOREIGN KEY constraint_name (column_name)
REFERENCES referenced_table(column_name);
ALTER TABLE table_name
ADD REFERENCE constraint_name FOREIGN KEY (column_name)
REFERENCES referenced_table(column_name);
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
ECM3435 IT Consulting 1 - Organisational IT environments

Quiz
•
University
10 questions
SQL JOINS

Quiz
•
University
10 questions
Lab 5 Review Quiz - Functions and Subqueries

Quiz
•
University
11 questions
Basics of JAVA

Quiz
•
University
7 questions
ICS113_Unix Commands

Quiz
•
University
11 questions
Data Security Quiz

Quiz
•
University
10 questions
java quiz based on interface

Quiz
•
University
15 questions
Quiz de SQL Básico

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University