cemedu.com logo | cemedu logo
gamini ai
User
AWS
AUTH
AXIOS
ADMIN
ANGULAR
ANDROID
ATOM PAYMENT
BPO
BCRYPTJS
BOOTSTRAP
BASIC COMPUTER
C LANGUAGE
C++
CSS
CANVA
COMMON QUESTIONS
CORELDRAW
CLOUDINARY
CONTENT WRITER
DSA
DJANGO
ERROR
EXCEL
EXPRESSJS
FLUTTER
GITHUB
GRAPHQL
GODADDY
HR
HTML5
HOSTINGER
JWT
JAVA
JSON
JQUERY
JAVASCRIPT
LINUX OS
LOOPBACK API
MYSQL
MANAGER
MONGODB
MARKETING
MS OFFICE
MONGOOSE
NODEJS
NEXTJS
PHP
PYTHON
PHOTOSHOP
POSTGRESQL
PAYU PAYMENT
PAYPAL PAYMENT
REDUX
REACTJS
ROUTER
REACT NATIVE
REACT ROUTER DOM
REACT HELMET
SASS
SEO
SMO
STRIPE PAYMENT
SYSTEM ADMINISTRATOR
SOFTWARE TESTING
TYPESCRIPT
TAILWIND
TELESALES
TALLY
VUEJS
WINDOWS OS
XML
100% free offer - Register now and enjoy unlimited access to all questions and courses, completely free! Hurry, this offer is for a limited time only!

Follow Us

About Us

We are dedicated to delivering high-quality services and products.
Our goal is to ensure customer satisfaction and offer exceptional value.

Quick Links

  • Home
  • About
  • Courses
  • Questions
  • Projects
  • Pricing
  • Contact us
  • Privacy & policy
  • Terms & conditions

© 2025 cemedu.com. All rights reserved.


Aws

Auth

Axios

Admin

Angular

Android

Atom Payment

BPO

BcryptJs

Bootstrap

Basic Computer

C Language

C++

Css

Canva

Common questions

CorelDraw

Cloudinary

Content Writer

DSA

Django

Error

Excel

ExpressJs

Flutter

Github

Graphql

GoDaddy

HR

Html5

Hostinger

Jwt

Java

Json

Jquery

Javascript

Linux OS

Loopback API

MySQL

Manager

MongoDB

Marketing

MS Office

Mongoose

NodeJs

NextJs

Php

Python

Photoshop

PostgreSQL

PayU Payment

Paypal Payment

Redux

ReactJs

Router

React Native

React Router Dom

React Helmet

Sass

SEO

SMO

Stripe Payment

System Administrator

Software Testing

Typescript

Tailwind

Telesales

Tally

VueJs

Windows OS

XML










SQL questions

How do you perform a JOIN operation in MySQL?

More details
2024-09-06 last updatedFreeMysql

In MySQL, JOIN operations are used to combine rows from two or more tables based on related columns. Use `INNER JOIN` to return records with matching values in both tables, `LEFT JOIN` to return all records from the left table and matched records from the right table, and `RIGHT JOIN` for the opposite. For example, `SELECT * FROM orders INNER JOIN customers ON orders.customer_id = customers.id` retrieves orders with customer details.
In MySQL, JOIN operations are used to combine rows from two or more tables based on related columns. Use `INNER JOIN` to return records with matching values in both tables, `LEFT JOIN` to return all records from the left table and matched records from the right table, and `RIGHT JOIN` for the opposite. For example, `SELECT * FROM orders INNER JOIN customers ON orders.customer_id = customers.id` retrieves orders with customer details.

What is 'mysqli' in PHP?

More details
2024-09-10 last updatedFreePhp

The `mysqli` (MySQL Improved) extension in PHP provides an interface to interact with MySQL databases. It offers improved functionality over the older `mysql` extension, including support for prepared statements, transactions, and multi-query execution. For example, you can connect to a database with `mysqli_connect('localhost', 'user', 'password', 'database')`. `mysqli` provides both procedural and object-oriented interfaces for database operations.
The `mysqli` (MySQL Improved) extension in PHP provides an interface to interact with MySQL databases. It offers improved functionality over the older `mysql` extension, including support for prepared statements, transactions, and multi-query execution. For example, you can connect to a database with `mysqli_connect('localhost', 'user', 'password', 'database')`. `mysqli` provides both procedural and object-oriented interfaces for database operations.

How do you use 'mysqli_prepare()' in PHP?

More details
2024-09-10 last updatedFreePhp

'mysqli_prepare()' is used in PHP to prepare an SQL statement for execution, allowing for parameterized queries that enhance security. For example: `$stmt = mysqli_prepare($conn, 'SELECT * FROM users WHERE email = ?');`. Placeholders (like `?`) are used in the query, and then parameters are bound using `mysqli_stmt_bind_param()`. This approach helps prevent SQL injection by separating the SQL code from the data.
'mysqli_prepare()' is used in PHP to prepare an SQL statement for execution, allowing for parameterized queries that enhance security. For example: `$stmt = mysqli_prepare($conn, 'SELECT * FROM users WHERE email = ?');`. Placeholders (like `?`) are used in the query, and then parameters are bound using `mysqli_stmt_bind_param()`. This approach helps prevent SQL injection by separating the SQL code from the data.

What is 'mysqli_fetch_assoc()' in PHP?

More details
2024-09-10 last updatedFreePhp

'mysqli_fetch_assoc()' fetches a result row as an associative array from a MySQL database query. For example: `while ($row = mysqli_fetch_assoc($result)) { echo $row['column_name']; }` retrieves rows from a result set where each row is an associative array with column names as keys. This function is useful for accessing query results in a readable format.
'mysqli_fetch_assoc()' fetches a result row as an associative array from a MySQL database query. For example: `while ($row = mysqli_fetch_assoc($result)) { echo $row['column_name']; }` retrieves rows from a result set where each row is an associative array with column names as keys. This function is useful for accessing query results in a readable format.

SQL Injection

More details
2024-09-10 last updatedFreeError

SQL Injection occurs when an attacker inserts malicious SQL code into a query, which can compromise the database. Prevent SQL Injection by using parameterized queries or prepared statements, validating and escaping user input, and implementing robust input validation and sanitization practices.
SQL Injection occurs when an attacker inserts malicious SQL code into a query, which can compromise the database. Prevent SQL Injection by using parameterized queries or prepared statements, validating and escaping user input, and implementing robust input validation and sanitization practices.

How do you back up a PostgreSQL database?

More details
2024-09-10 last updatedFreePostgreSQL

To back up a PostgreSQL database, use the `pg_dump` utility. For example, to back up a database named 'mydb', you would run `pg_dump mydb > mydb_backup.sql`. This creates a SQL file with the database structure and data. You can restore this backup using the `psql` command with `psql mydb < mydb_backup.sql`.
To back up a PostgreSQL database, use the `pg_dump` utility. For example, to back up a database named 'mydb', you would run `pg_dump mydb > mydb_backup.sql`. This creates a SQL file with the database structure and data. You can restore this backup using the `psql` command with `psql mydb < mydb_backup.sql`.

How do you use `EXISTS` in a query?

More details
2024-09-10 last updatedFreePostgreSQL

`EXISTS` is used in SQL to test for the existence of rows returned by a subquery. It returns `TRUE` if the subquery returns one or more rows and `FALSE` otherwise. For example: `SELECT * FROM employees WHERE EXISTS (SELECT 1 FROM departments WHERE departments.dept_id = employees.dept_id);` checks if there are corresponding departments for employees.
`EXISTS` is used in SQL to test for the existence of rows returned by a subquery. It returns `TRUE` if the subquery returns one or more rows and `FALSE` otherwise. For example: `SELECT * FROM employees WHERE EXISTS (SELECT 1 FROM departments WHERE departments.dept_id = employees.dept_id);` checks if there are corresponding departments for employees.

How do you create and use a PostgreSQL function?

More details
2024-09-10 last updatedFreePostgreSQL

To create a function in PostgreSQL, use the `CREATE FUNCTION` statement along with PL/pgSQL or another procedural language. For example: `CREATE FUNCTION get_employee_name(emp_id INT) RETURNS TEXT AS $$ BEGIN RETURN (SELECT name FROM employees WHERE id = emp_id); END; $$ LANGUAGE plpgsql;`. Use the function by calling `SELECT get_employee_name(1);`.
To create a function in PostgreSQL, use the `CREATE FUNCTION` statement along with PL/pgSQL or another procedural language. For example: `CREATE FUNCTION get_employee_name(emp_id INT) RETURNS TEXT AS $$ BEGIN RETURN (SELECT name FROM employees WHERE id = emp_id); END; $$ LANGUAGE plpgsql;`. Use the function by calling `SELECT get_employee_name(1);`.

How do you handle large objects (LOBs) in PostgreSQL?

More details
2024-09-10 last updatedFreePostgreSQL

In PostgreSQL, large objects (LOBs) are handled using the `pg_largeobject` system catalog and associated functions. You can store large objects like files or images using `lo_create()`, `lo_write()`, and `lo_read()` functions. For example, to store a file: `SELECT lo_create(0);` to create a new large object, and then use `lo_write()` to write data. You can retrieve it with `lo_read()` and manage large objects using the `pg_largeobject` catalog.
In PostgreSQL, large objects (LOBs) are handled using the `pg_largeobject` system catalog and associated functions. You can store large objects like files or images using `lo_create()`, `lo_write()`, and `lo_read()` functions. For example, to store a file: `SELECT lo_create(0);` to create a new large object, and then use `lo_write()` to write data. You can retrieve it with `lo_read()` and manage large objects using the `pg_largeobject` catalog.

What are PostgreSQL extension modules and how do you install them?

More details
2024-09-10 last updatedFreePostgreSQL

PostgreSQL extensions add additional functionality to the database system. You can install extensions using the `CREATE EXTENSION` command. For example, to install the `pg_trgm` extension for trigram-based text search, use `CREATE EXTENSION pg_trgm;`. Extensions can be managed via the `pg_extension` catalog. Some extensions come with PostgreSQL distributions, while others may need to be downloaded and installed separately.
PostgreSQL extensions add additional functionality to the database system. You can install extensions using the `CREATE EXTENSION` command. For example, to install the `pg_trgm` extension for trigram-based text search, use `CREATE EXTENSION pg_trgm;`. Extensions can be managed via the `pg_extension` catalog. Some extensions come with PostgreSQL distributions, while others may need to be downloaded and installed separately.

What are user-defined functions in MySQL?

More details
2024-09-19 last updatedFreeMySQL

User-defined functions (UDFs) allow users to create custom functions to encapsulate reusable logic in SQL. UDFs can take parameters and return values. For example, a UDF to calculate tax could be defined as `CREATE FUNCTION CalculateTax(amount DECIMAL) RETURNS DECIMAL BEGIN RETURN amount * 0.1; END;`.
User-defined functions (UDFs) allow users to create custom functions to encapsulate reusable logic in SQL. UDFs can take parameters and return values. For example, a UDF to calculate tax could be defined as `CREATE FUNCTION CalculateTax(amount DECIMAL) RETURNS DECIMAL BEGIN RETURN amount * 0.1; END;`.

What is the purpose of the CASE statement?

More details
2024-09-19 last updatedFreeMySQL

The CASE statement allows conditional logic in SQL queries, returning values based on specified conditions. It works like an IF statement. For example, `SELECT name, CASE WHEN score >= 60 THEN 'Pass' ELSE 'Fail' END AS result FROM exams;` assigns 'Pass' or 'Fail' based on the score.
The CASE statement allows conditional logic in SQL queries, returning values based on specified conditions. It works like an IF statement. For example, `SELECT name, CASE WHEN score >= 60 THEN 'Pass' ELSE 'Fail' END AS result FROM exams;` assigns 'Pass' or 'Fail' based on the score.

What are the differences between MyISAM and InnoDB?

More details
2024-09-19 last updatedFreeMySQL

MyISAM is a non-transactional storage engine, ideal for read-heavy applications, while InnoDB supports transactions, foreign keys, and row-level locking, making it suitable for high-concurrency environments. For instance, InnoDB is preferable for e-commerce sites where data integrity is critical.
MyISAM is a non-transactional storage engine, ideal for read-heavy applications, while InnoDB supports transactions, foreign keys, and row-level locking, making it suitable for high-concurrency environments. For instance, InnoDB is preferable for e-commerce sites where data integrity is critical.

What are the key differences between SQL and MongoDB?

More details
2024-09-19 last updatedFreeMongoDB

Key differences between SQL databases and MongoDB include data structure, schema, and query language. SQL uses tables with fixed schemas, while MongoDB uses collections of documents with flexible schemas. SQL queries are structured in SQL language, whereas MongoDB uses a JSON-like query syntax, making it more intuitive for developers familiar with JSON.
Key differences between SQL databases and MongoDB include data structure, schema, and query language. SQL uses tables with fixed schemas, while MongoDB uses collections of documents with flexible schemas. SQL queries are structured in SQL language, whereas MongoDB uses a JSON-like query syntax, making it more intuitive for developers familiar with JSON.

How do you perform a JOIN operation in MySQL?
What is 'mysqli' in PHP?
How do you use 'mysqli_prepare()' in PHP?
What is 'mysqli_fetch_assoc()' in PHP?
SQL Injection
How do you back up a PostgreSQL database?
How do you use `EXISTS` in a query?
How do you create and use a PostgreSQL function?
How do you handle large objects (LOBs) in PostgreSQL?
What are PostgreSQL extension modules and how do you install them?
What are user-defined functions in MySQL?
What is the purpose of the CASE statement?
What are the differences between MyISAM and InnoDB?
What are the key differences between SQL and MongoDB?

1