Technical Interview Flashcards
What are the different types of SQL joins?
Inner Join, Left Join, Right Join, Cross Join
What is a Unique constraint?
In SQL, UNIQUE constraint is a database constraint that ensures that all values in a specific column (or a combination of columns) are unique across all rows in a table. This means that no two rows can have the same value(s) in the column(s) with a UNIQUE constraint. UNIQUE constraints are used to enforce data integrity and maintain the uniqueness of data in a table.
What are the differences between IN and BETWEEN operators?
The IN operator allows you to determine if a value matches any value in a list of values while The BETWEEN operator is a logical operator that specifies whether a value is in a range or not.
What is meant by normalization in SQL?
Normalization is a process or set of guidelines used to optimally design a database to reduce redundant data. The actual guidelines of normalization are called normal forms.
Is a blank space or a zero value treated the same way as the operator NULL?
No, blank spaces or zero values are not treated the same as NULL in SQL. NULL represents the absence of a value, while blank spaces and zero values are actual data.
What is the default ordering of the ORDER BY clause and how can you change the default order?
The default ordering of the ORDER BY clause is ascending (ASC). To change the order to descending (DESC), you can add DESC after the column name. For example, ORDER BY column_name DESC
Write an SQL query to find all candidates’ names from a table named
‘Candidates’ that end with ‘K’.
SELECT * FROM Candidates WHERE name LIKE ‘%K’;
Change Data Capture (CDC): what it is and how does it work?
Change Data Capture is a technique used to identify and capture changes made to data, whether those changes are inserts, updates, or deletes. The goal is to keep a record of all data changes in the system, making it easier to synchronize, replicate, or analyze these changes. CDC is useful for data warehousing, and ETL processes where you need to maintain up-to-date information without constantly querying the entire dataset.
Types include:
Trigger-Based CDC
Log-Based CDC
Polling or Timestamp-Based CDC
Database-mirroring CDC
API-Based
Let’s suppose you want to deal with duplicate data in the SQL query. What functions are suitable for dealing with such data?
SQL provides several functions to deal with duplicate data, including DISTINCT, GROUP BY, and aggregate functions like COUNT(). These functions allow you to identify and eliminate duplicate rows or summarize data based on common attribute
Explain SQL indexing
In SQL, indexing is a database optimization technique used to improve the retrieval speed of rows from database tables. An index is a data structure that provides a quick way to look up rows in a table based on the values in one or more columns. Indexes are analogous to the indexes you find in a book: they help you quickly locate specific information without having to scan every page
What are the various kinds of permission under Linux?
Also, explain how to change permissions.
In Linux, there are three types of permissions: read (r), write (w), and execute (x). These permissions can be set for three categories of users: owner (u), group (g), and others (o).
You can change permissions using the chmod command, followed by a symbolic representation (e.g., chmod u+x filename to add execute permission for the owner).
What command would you use for editing, searching, and replacing text in Linux?
To search for text in a file, you can use the grep command:
grep ‘search-text’ filename
To search for text in multiple files within a directory (recursively), you can use the -r option:
grep -r ‘search-text’ directory/
To search for text in a case-insensitive manner, use the -i option
grep -i ‘search-text’ filename
Are Arguments in Python Passed by Value or by Reference?
All arguments are passed by reference
What Is the Difference Between a List and a Tuple?
Mutability:
List: Lists are mutable, which means you can change their contents (add, remove, or modify elements) after creation. You can use methods like append(), insert(), and remove() to modify a list.
Tuple: Tuples are immutable, which means once you create a tuple, you cannot change its contents. You cannot add, remove, or modify elements in a tuple after it’s created. This immutability can make tuples faster and safer in certain situations.
Syntax:
List: Lists are created using square brackets [], e.g., my_list = [1, 2, 3].
Tuple: Tuples are created using parentheses (), e.g., my_tuple = (1, 2, 3).
How would you access and read a dataset in CSV Format on Google Spreadsheet? (read directly from the internet)
Import Pandas
Url = “url”
Dataframe = pd.read_csv(url)
Python
Import Pandas
Url = “url”
Dataframe = pd.read_csv(url)