SQL - 01 Flashcards
What is the difference between a CPU Core and a CPU Thread?
A CPU core is the physical part of the CPU that performs the computing work. A thread, on the other hand, is a virtual component that manages tasks. Some CPUs use multi-threading to allow each core to handle multiple tasks simultaneously.
What is a CPU Core?
A CPU core is an individual processing unit within a computer’s central processing unit (CPU). It can independently execute computer instructions, allowing for more efficient processing of multiple tasks.
How does Multi-Core CPU differ from a Single-Core CPU?
A multi-core CPU has multiple cores, allowing it to perform multiple processes simultaneously, greatly improving performance over single-core CPUs, especially for multi-threaded applications.
What is a Virtual Core?
A virtual core, commonly known as a thread, is a subdivision of a physical CPU core. It allows a single core to execute multiple threads or tasks concurrently, enhancing the CPU’s multitasking capabilities.
How do Virtual Cores Work in CPUs?
Through a technology known as simultaneous multithreading (SMT), such as Intel’s Hyper-Threading, a single physical core is split into multiple virtual cores, allowing it to handle more than one instruction stream at a time.
What is the advantage of having Virtual Cores?
Virtual cores improve the efficiency of CPU resource utilization, allowing for better performance in multi-threaded applications and multitasking scenarios.
Do Virtual Cores double the performance of Physical Cores?
While virtual cores increase a CPU’s ability to handle multiple tasks, they do not double the performance. The performance gain depends on the nature of the tasks and the application’s ability to utilize multithreading.
How can you identify Virtual Cores in your system?
You can identify virtual cores in your system by checking the CPU specifications in the system settings or using system information tools. A CPU with SMT will show twice as many cores as the physical core count.
What is a Super Key?
A super key is a set of one or more columns (attributes) that can uniquely identify a record in a database table. It may contain additional attributes that are not necessary for unique identification.
What is a Primary Key?
A primary key is a specific type of super key. It’s a minimal set of columns that can uniquely identify each row in a table. Each table has a single primary key, and its values must be unique and not null.
What is a Unique Key?
A unique key is similar to a primary key in that it must contain unique values. The difference is that a table can have multiple unique keys, and unlike primary keys, they can contain null values (unless otherwise specified).
How is a Super Key different from a Primary Key?
While both super keys and primary keys uniquely identify records, super keys may contain additional attributes that aren’t necessary for uniqueness. A primary key is a minimal super key, meaning it has no unnecessary attributes.
When is a Unique Key used over a Primary Key?
A unique key is used when there is a need to enforce uniqueness on a column that is not the primary key. For instance, you might use it for a secondary identifier that must be unique, like an email address or employee ID.
What is a Candidate Key?
A candidate key is a set of one or more fields/columns in a table that can uniquely identify a record. Any candidate key can potentially become a primary key.
How does a Candidate Key differ from a Primary Key?
While both candidate and primary keys uniquely identify records in a table, the primary key is the chosen candidate key for that purpose. Other candidate keys become alternate keys.
Can a table have more than one Candidate Key?
Yes, a table can have multiple candidate keys, each capable of uniquely identifying a record. Only one of these is selected as the primary key.
What are the characteristics of a Candidate Key?
A candidate key must contain unique values and cannot have null values. Each value in the key must uniquely identify a row in the table.