1) c) Organized collection of data or information that can be accessed, updated, and managed
2) c) Table
3) a) All Correct
4) c) WHERE clause
The WHERE clause is incomplete and needs a condition to specify which records to update.
5) a) True
6) a) SELECT * FROM Employees WHERE FirstName=’Peter’ AND LastName=’Jackson’
7) a) All Correct
8) b) >= ‘2023-06-01’
The OR operator should be followed by a complete condition, including the column name. SELECT * FROM Orders WHERE OrderDate >= ‘2023-01-01’ OR OrderDate >= ‘2023-06-01’;
9) c) HAVING
10) c) No error
11) a) SELECT * FROM Employees WHERE LastName BETWEEN ‘Hansen’ AND ‘Pettersen’
12) a) SELECT DISTINCT
13) a) ORDER BY
14) a) SELECT * FROM Employees ORDER BY FirstName DESC
15) a) INSERT INTO Employees VALUES (‘Jimmy’, ‘Jackson’)
16) a) INSERT INTO Persons (LastName) VALUES (‘Olsen’)
17) c) To give users access privileges
18) b) Removes specific access privileges from users
19) d) All Correct
20) c) ON Database
This is because the REVOKE statement usually specifies the type of object (such as a) specific table or schema) with tables). Just mentioning Database without specifying an object within it is incorrect. The corrected syntax typically needs to look like:
REVOKE INSERT, UPDATE ON Database.* FROM user123;
21) a) UPDATE Employees SET LastName=’Nilsen’ WHERE LastName=’Hansen’
22) a) DELETE FROM Employees WHERE FirstName = ‘Peter’
Welcome to the SQL Quiz! This blog post features 25 multiple-choice questions that explore essential concepts of SQL.
1. What is a database?
Select the best answer
a) Organized collection of information that cannot be accessed, updated, and managed b) Collection of data or information without organizing c) Organized collection of data or information that can be accessed, updated, and managed d) Organized collection of data that cannot be updated
6. With SQL, how do you select all the records from a table named “Employees” where the “FirstName” is “Peter” and the “LastName” is “Jackson”?
Choose one option
a) SELECT * FROM Employees WHERE FirstName='Peter' AND LastName='Jackson'
b) SELECT FirstName='Peter', LastName='Jackson' FROM Employees
c) SELECT * FROM Employees WHERE FirstName<>'Peter' AND LastName<>'Jackson'
d) SELECT * FROM Employees WHERE FirstName='Jackson' AND LastName='Peter'
11. With SQL, how do you select all the records from a table named “Employees” where the “LastName” is alphabetically between (and including) “Hansen” and “Pettersen”?
Choose one option
a) SELECT * FROM Employees WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
b) SELECT * FROM Employees WHERE LastName>'Hansen' AND LastName<'Pettersen'
c) SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Employees
d) None
14. With SQL, how can you return all the records from a) table named “Employees” sorted descending by “FirstName”?
Choose one option
a) SELECT * FROM Employees ORDER BY FirstName DESC
b) SELECT * FROM Employees SORT 'FirstName' DESC
c) SELECT * FROM Employees SORT BY 'FirstName' DESC
d) SELECT * FROM Employees ORDER FirstName DESC
15. With SQL, how can you insert a new record into the “Employees” table?
Choose one option
a) INSERT INTO Employees VALUES ('Jimmy', 'Jackson')
b) INSERT VALUES ('Jimmy', 'Jackson') INTO Employees
c) INSERT ('Jimmy', 'Jackson') INTO Employees
d) INSERT INTO Table Employees VALUES ('Jimmy', 'Jackson')
16. With SQL, how can you insert “Olsen” as the “LastName” in the “Persons” table?
Choose one option
a) INSERT INTO Persons (LastName) VALUES ('Olsen')
b) INSERT ('Olsen') INTO Persons (LastName)
c) INSERT INTO Persons ('Olsen') INTO LastName
d) All incorrect
21. How can you change “Hansen” into “Nilsen” in the “LastName” column in the Employees table?
Choose one option
a) UPDATE Employees SET LastName='Nilsen' WHERE LastName='Hansen'
b) MODIFY Employees SET LastName='Nilsen' WHERE LastName='Hansen'
c) UPDATE Employees SET LastName='Hansen' INTO LastName='Nilsen'
d) MODIFY Employees SET LastName='Hansen' INTO LastName='Nilsen
22. With SQL, how can you delete the records where the “FirstName” is “Peter” in the Employees Table?
Choose one option
a) DELETE FROM Employees WHERE FirstName = 'Peter'
b) DELETE FirstName='Peter' FROM Employees
c) DELETE ROW FirstName='Peter' FROM Employees
d) All are incorrect
In Git, HEAD is a special pointer or reference that points to the currently checked-out commit in the repository.
12) b) git reset HEAD~1
The git reset HEAD~1 command moves the current branch pointer back to the previous commit, effectively undoing the most recent commit. Note that there are different modes (like –soft, –hard) which decide the fate of changes during this operation.
Git supports various merge strategies like fast-forward, recursive, and octopus. “squid” is not a merge strategy in Git.
16) d) git branch
17) b) Applies changes from a specific commit to the current branch
18) a) git clean
The git clean command removes untracked files from your working directory, ensuring your workspace is tidy.
19) c) A repository without a working directory
A bare repository in Git is a repository that contains only the .git directory and no working directory. It’s typically used for shared repositories and remotes.
20) b) git diff
21) a) git merge
The git merge command integrates changes from one branch into another. This is commonly used when features or bug fixes from one branch need to be brought into the main branch.
22) c) Overlapping changes between branches
A merge conflict occurs when there are changes in the same part of a file in both the current branch and the branch to be merged. Git cannot decide which change should take precedence, so it asks the user to resolve the conflict.
2. Which of the following problems does Git help solve
Choose one option
a) Recovering older versions of a software project b) Developing multiple versions of a software project in parallel c) Merging changes to a software project made by collaborating developers working in parallel d) All of the above e) None of the above
4. In Git, which error would you get if you try to push master-branch changes to a remote repository, and someone else pushed changes to that same branch while you were making your changes?
Choose one option
a) Rejected b) 404 c) 500 d) Access denied e) 400 Bad request
6. Imagine that you just joined a development team that uses Git for version control and collaboration. To start contributing to the project, what Git operation would you most likely invoke first?
a) checkout b) clone c) export d) revert e) update
7. Imagine that you have a local repository, but other team members have pushed changes into the remote repository. What Git operation would you use to download those changes into your working copy?
a) The first commit in the repository b) The latest commit in the remote repository c) The currently checked-out commit d) The base of the current branch
a) Picks a random commit from history b) Applies changes from a specific commit to the current branch c) Deletes a specific commit d) Merges two unrelated branches
a) An error in the Git configuration b) A disagreement among team members c) Overlapping changes between branches d) An issue with remote repository synchronization
14. What is the difference between the DROP and TRUNCATE commands in SQL?
Choose one option
a) DROP deletes the table, TRUNCATE deletes only the table data b) TRUNCATE deletes the table, DROP deletes only the table data c) No difference d) Both commands modify table data
18. With SQL, how do you select all the records from a table named “Students” where the value of the column “FirstName” is “Peter”?
Choose one option
a) SELECT * FROM Students WHERE FirstName='Peter'
b) SELECT * FROM Students WHERE FirstName<>'Peter'
c) SELECT [all] FROM Students WHERE FirstName LIKE 'Peter'
d) SELECT [all] FROM Students WHERE FirstName='Peter'
19. With SQL, how do you select all the records from a table named “Students” where the value of the column “FirstName” starts with an “a”?
a) SELECT * FROM Students WHERE FirstName LIKE 'a%'
b) SELECT * FROM Students WHERE FirstName='%a%'
c) SELECT * FROM Students WHERE FirstName='a'
d) SELECT * FROM Students WHERE FirstName LIKE '%a'
20. How does a transaction ensure data integrity in SQL?
Choose one option
a) By locking the database b) By allowing multiple users to modify data simultaneously c) By ensuring all operations within the transaction are completed before committing d) By automatically updating all related tables
a) Ignored files are tracked in a special file named as .gitignore named which is checked in at the root of the repository. b) Create a file .ignore and track the ignored file in it c) You can not ignore files in GIT
a) A separate version of the main repository. b) A small wooden stick you can use to type commands. c) Nothing, it is a nonsense word. d) A secret part of Git config.
18. What will the following command print to the Terminal?
git remote -v
Choose one option
a) The current git version you’re running b) A list of remote repositories you are connected to c) The last 5 git versions you’ve installed d) An inline editor for modifying remote repositories
Welcome to the DevOps Quiz! This blog post features answers to DevOps questions that explore key DevOps concepts, covering foundational principles and commonly used tools in a typical DevOps pipeline.
CI stands for Continuous Integration, a practice where developers integrate code into a shared repository frequently.
3) a)Jenkins
Jenkins is a widely used open-source tool that facilitates both Continuous Integration and Continuous Deployment.
4) b) It involves moving code in large amounts
Continuous Integration in Agile typically involves moving code in small, frequent intervals rather than large amounts. This helps in the early detection of integration issues and ensures that changes are regularly integrated into a shared repository, reducing the risk of conflicts and improving overall collaboration.
5) d) Version Control, Build,Auto Test, Deploy
6) a) Operating
7) b) Implants Manual Errors
8) d) Jira
Chef, Puppet, and Ansible are configuration management tools, Jira is an issue and project tracking tool.
9) c) Containerization
Docker is primarily known for creating, deploying, and running applications in containers.
10) c) Container orchestration
Kubernetes is a platform designed to manage containerized workloads and services.
11) d) Git
Git is a distributed version control system commonly used in the DevOps world.
12) a)Version control
Version control systems are tools that allow teammates to track and manage changes made to a file or set of files.
13) c) Infrastructure as Code
IaC or Infrastructure as Code is a method to provision and manage IT infrastructure through code and automation.
14) c) Reduced recovery time after failures
15) b) Incorporating operations earlier in the development cycle
16) c) Collaboration and sharing between teams
17) a) Writing scripts (code) to automate infrastructure deployment
18) b) Test
19) b) Culture, Automation, Lean, Measurement, Sharing
20) c) Ansible
Ansible is a popular tool for configuration management, automating tasks such as software configuration and deployment.
21) c) Slack
22) c) Deploys changes gradually to reduce the impact on users.
23) d) Acceptance Testing
24) c) Continuous Integration
25) b) Containers have a smaller footprint and faster startup times.