Junior — Middle
Have you had experience working with MySQL database management systems?
sobes.tech AI
Answer from AI
Yes, I have experience working with MySQL. I have created and optimized queries, designed database schemas, and also used ORM libraries to interact with MySQL from Node.js applications.
For example, in one project, I implemented a REST API for user management, where data was stored in MySQL. I used the mysql2 package for connection and wrote queries for data retrieval, insertion, and updating.
const mysql = require('mysql2/promise');
async function getUserById(id) {
const connection = await mysql.createConnection({host: 'localhost', user: 'root', database: 'test'});
const [rows] = await connection.execute('SELECT * FROM users WHERE id = ?', [id]);
await connection.end();
return rows[0];
}
I am also familiar with setting up indexes and query optimization to improve performance.